// insert ...
const { Blog,User}  =  require('./model') 


// 异步创建
!(async function () {
  
  // 创建用户
  const zhangsan = await User.create({
    userName:'张三',
    password:'123456',
    nickname:'小三'
  })
  // 获取内容

  console.log(zhangsan.dataValues)

  const id_zhangsan = zhangsan.dataValues.id;

  const lisi = await User.create({
    userName:'李四',
    password:'123456',
    nickname:'小四'
  })

  const id_lisi = lisi.dataValues.id;


  // 创建博客
  const blog1 = await Blog.create({
    title:'标题1',
    content:'博客1博客1',
    userId:id_zhangsan
  })

  const blog2 = await Blog.create({
    title:'标题2',
    content:'博客2博客2',
    userId:id_zhangsan
  })

  const blog3 = await Blog.create({
    title:'标题3',
    content:'博客3博客3',
    userId:id_lisi
  })


  const blog4 = await Blog.create({
    title:'标题4',
    content:'博客4博客4',
    userId:id_lisi
  })

})()